import request from '@/config/axios'

// 竞赛情况 VO
export interface TeacherCompetitionVO {
  // 编号
  id: number
  // 教师工号
  teacherNumber: string
  // 教师姓名
  teacherName: string
  // 部门id
  deptId: number
  // 竞赛名称
  competitionName: string
  // 获奖等级
  awardsLevel: string
  // 获奖类别
  awardsCategory: number
  // 授予单位
  awardingAuthority: string
  // 获得时间（年月）
  awardDate: Date
  // 备注
  remark: string
  // 状态
  status: number
  // 审核未通过原因
  reason: string
}

// 竞赛情况 API
export const TeacherCompetitionApi = {
  // 查询竞赛情况分页
  getTeacherCompetitionPage: async (params: any) => {
    return await request.get({ url: `/data/teacher-competition/page`, params })
  },

  // 查询竞赛情况详情
  getTeacherCompetition: async (id: number) => {
    return await request.get({ url: `/data/teacher-competition/get?id=` + id })
  },

  // 新增竞赛情况
  createTeacherCompetition: async (data: TeacherCompetitionVO) => {
    return await request.post({ url: `/data/teacher-competition/create`, data })
  },

  // 修改竞赛情况
  updateTeacherCompetition: async (data: TeacherCompetitionVO) => {
    return await request.put({ url: `/data/teacher-competition/update`, data })
  },

  // 修改竞赛情况
  updateTeacherCompetitionStatus: async (data) => {
    return await request.put({ url: `/data/teacher-competition/updateStatus`, data })
  },

  // 删除竞赛情况
  deleteTeacherCompetition: async (id: number) => {
    return await request.delete({ url: `/data/teacher-competition/delete?id=` + id })
  },

  // 导出竞赛情况 Excel
  exportTeacherCompetition: async (params) => {
    return await request.download({ url: `/data/teacher-competition/export-excel`, params })
  }
}
